#ifndef __IRQ_CPUSTAT_H
#define __IRQ_CPUSTAT_H

#include "linux/smp.h"
#include <linux/cache.h>

#define NR_IPI	7

typedef struct
{
    unsigned int __softirq_pending;
#ifdef CONFIG_SMP
    unsigned int ipi_irqs[NR_IPI];
#endif
} ____cacheline_aligned irq_cpustat_t;

#define __inc_irq_stat(cpu, member) __IRQ_STAT(cpu, member)++
#define __get_irq_stat(cpu, member) __IRQ_STAT(cpu, member)

extern irq_cpustat_t irq_stat[];
#define __IRQ_STAT(cpu, member)	(irq_stat[cpu].member)


#define __inc_irq_stat(cpu, member)	__IRQ_STAT(cpu, member)++
#define __get_irq_stat(cpu, member)	__IRQ_STAT(cpu, member)

#define local_softirq_pending()  __IRQ_STAT(smp_processor_id(), __softirq_pending)

#endif

